#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "DevicesCRC.h"



uint8_t buff[] = "Hello honrun";


int main(void)
{
    printf("\r\nCRC7 test.\r\n");
    printf("ucCRC7_MMC:             %02X\r\n",  ucCRC7_MMC(NULL, buff, strlen((char *)buff)));

    printf("\r\nCRC8 test.\r\n");
    printf("ucCRC8:                 %02X\r\n",  ucCRC8(NULL, buff, strlen((char *)buff)));
    printf("ucCRC8_ITU:             %02X\r\n",  ucCRC8_ITU(NULL, buff, strlen((char *)buff)));
    printf("ucCRC8_ROHC:            %02X\r\n",  ucCRC8_ROHC(NULL, buff, strlen((char *)buff)));
    printf("ucCRC8_MAXIM:           %02X\r\n",  ucCRC8_MAXIM(NULL, buff, strlen((char *)buff)));

    printf("\r\nCRC16 test.\r\n");
    printf("usCRC16_MAXIM:          %04X\r\n",  usCRC16_MAXIM(NULL, buff, strlen((char *)buff)));
    printf("usCRC16_USB:            %04X\r\n",  usCRC16_USB(NULL, buff, strlen((char *)buff)));
    printf("usCRC16_MODBUS:         %04X\r\n",  usCRC16_MODBUS(NULL, buff, strlen((char *)buff)));
    printf("usCRC16_CCITT:          %04X\r\n",  usCRC16_CCITT(NULL, buff, strlen((char *)buff)));
    printf("usCRC16_CCITT_FALSE:    %04X\r\n",  usCRC16_CCITT_FALSE(NULL, buff, strlen((char *)buff)));
    printf("usCRC16_X25:            %04X\r\n",  usCRC16_X25(NULL, (uint32_t *)buff, strlen((char *)buff)));
    printf("usCRC16_XMODEM:         %04X\r\n",  usCRC16_XMODEM(NULL, (uint32_t *)buff, strlen((char *)buff)));
    printf("usCRC16_DNP:            %04X\r\n",  usCRC16_DNP(NULL, (uint32_t *)buff, strlen((char *)buff)));

    printf("\r\nCRC32 test.\r\n");
    printf("CRC32:                  %08X\r\n",  uiCRC32(NULL, buff, strlen((char *)buff)));
    printf("CRC32_BZIP2:            %08X\r\n",  uiCRC32_BZIP2(NULL, buff, strlen((char *)buff)));
    printf("CRC32_MPEG2:            %08X\r\n",  uiCRC32_MPEG2(NULL, buff, strlen((char *)buff)));
    printf("CRC32_POSIX:            %08X\r\n",  uiCRC32_POSIX(NULL, buff, strlen((char *)buff)));
    printf("CRC32_JAMCRC:           %08X\r\n",  uiCRC32_JAMCRC(NULL, buff, strlen((char *)buff)));
    printf("CRC32_STM32:            %08X\r\n",  uiCRC32_STM32(NULL, (uint32_t *)buff, strlen((char *)buff)));

    return 0;
}
